<?php 
//Config : Les informations personnels de l'instance (log, pass, etc)
require("../include/config.php");

//API Fonctions : les fonctions fournis de base par l'API
require("../API/php/fonctions.php");

//Header établie la connection à la base $connection
require("../API/php/header.php");

//Fonctions : Fonctions personnelles de l'instance
require("../php/fonctions.php");

//Mode debug
$modeDebug = false;

//Public ou privé (clé obligatoire)
$modePublic = true;

//Mode de sortie text,json,xml,csv
//pour xml et csv $object_retour->data["resultat"] doit contenir qu'un est unique array
$modeSortie = "json";

//Liens de test
// phpsql/getKPISupport.php?milis=123450&ctrl=ok&date=2014-03-06

// IN obligatoire
$arrayInput = array(
    "ctrl" => null,
    "date" => null
);

//Récupération des entrants
$arrayValeur = recupInput($arrayInput);

//Object retour minima
// $object_retour->strErreur string
// $object_retour->data  string
// $object_retour->statut  string
    
$object_retour->metro["etape0"] = getDateTimeWithMili();

$v_test = setParameter("dateSituation",$arrayValeur["date"]);

$param = new stdClass();
$param->date=$arrayValeur["date"];
$retour = buildSituation("ID0", 3600, $param);
$object_retour->recal["statut"] = $retour->data["recal"];
$object_retour->recal["metro"] = $retour->metro;

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// réouvert avec SLA dépassé Critique
$param = new stdClass();
$param->priorite=35;
$param->date=$arrayValeur["date"];
$ID2a = getIndicateur($connection,$prefixTable, "ID2", 60, $param);

$object_retour->data["ID2a"] = intval($ID2a->data->data["nombre"]);

//--------------------------------------------------------------------------
// réouvert avec SLA dépassé Haute
$param = new stdClass();
$param->priorite=36;
$param->date=$arrayValeur["date"];
$ID2b = getIndicateur($connection,$prefixTable, "ID2", 60, $param);

$object_retour->data["ID2b"] = intval($ID2b->data->data["nombre"]);

//--------------------------------------------------------------------------
// réouvert avec SLA dépassé Moyenne
$param = new stdClass();
$param->priorite=37;
$param->date=$arrayValeur["date"];
$ID2c = getIndicateur($connection,$prefixTable, "ID2", 60, $param);

$object_retour->data["ID2c"] = intval($ID2c->data->data["nombre"]);

//--------------------------------------------------------------------------
// réouvert avec SLA dépassé Basse
$param = new stdClass();
$param->priorite=38;
$param->date=$arrayValeur["date"];
$ID2d = getIndicateur($connection,$prefixTable, "ID2", 60, $param);

$object_retour->data["ID2d"] = intval($ID2d->data->data["nombre"]);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// le stock Critique
$param = new stdClass();
$param->priorite=35;
$ID3a = getIndicateur($connection,$prefixTable, "ID3", 60, $param);

$object_retour->data["ID3a"] = intval($ID3a->data->data["nombre"]);

//--------------------------------------------------------------------------
// le stock Haute
$param = new stdClass();
$param->priorite=36;
$ID3b = getIndicateur($connection,$prefixTable, "ID3", 60, $param);

$object_retour->data["ID3b"] = intval($ID3b->data->data["nombre"]);

//--------------------------------------------------------------------------
// le stock Moyenne
$param = new stdClass();
$param->priorite=37;
$ID3c = getIndicateur($connection,$prefixTable, "ID3", 60, $param);

$object_retour->data["ID3c"] = intval($ID3c->data->data["nombre"]);

//--------------------------------------------------------------------------
// le stock Basse
$param = new stdClass();
$param->priorite=38;
$ID3d = getIndicateur($connection,$prefixTable, "ID3", 60, $param);

$object_retour->data["ID3d"] = intval($ID3d->data->data["nombre"]);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// reçu Critique
$param = new stdClass();
$param->priorite=35;
$param->date=$arrayValeur["date"];
$ID4a = getIndicateur($connection,$prefixTable, "ID4", 60, $param);

$object_retour->data["ID4a"] = intval($ID4a->data->data["nombre"]);

//--------------------------------------------------------------------------
// reçu Haute
$param = new stdClass();
$param->priorite=36;
$param->date=$arrayValeur["date"];
$ID4b = getIndicateur($connection,$prefixTable, "ID4", 60, $param);

$object_retour->data["ID4b"] = intval($ID4b->data->data["nombre"]);

//--------------------------------------------------------------------------
// reçu Moyenne
$param = new stdClass();
$param->priorite=37;
$param->date=$arrayValeur["date"];
$ID4c = getIndicateur($connection,$prefixTable, "ID4", 60, $param);

$object_retour->data["ID4c"] = intval($ID4c->data->data["nombre"]);

//--------------------------------------------------------------------------
// reçu Basse
$param = new stdClass();
$param->priorite=38;
$param->date=$arrayValeur["date"];
$ID4d = getIndicateur($connection,$prefixTable, "ID4", 60, $param);

$object_retour->data["ID4d"] = intval($ID4d->data->data["nombre"]);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// en attente Critique
$param = new stdClass();
$param->priorite=35;
$ID5a = getIndicateur($connection,$prefixTable, "ID5", 60, $param);

$object_retour->data["ID5a"] = intval($ID5a->data->data["nombre"]);

//--------------------------------------------------------------------------
// en attente Haute
$param = new stdClass();
$param->priorite=36;
$ID5b = getIndicateur($connection,$prefixTable, "ID5", 60, $param);

$object_retour->data["ID5b"] = intval($ID5b->data->data["nombre"]);

//--------------------------------------------------------------------------
// en attente Moyenne
$param = new stdClass();
$param->priorite=37;
$ID5c = getIndicateur($connection,$prefixTable, "ID5", 60, $param);

$object_retour->data["ID5c"] = intval($ID5c->data->data["nombre"]);

//--------------------------------------------------------------------------
// en attente Basse
$param = new stdClass();
$param->priorite=38;
$ID5d = getIndicateur($connection,$prefixTable, "ID5", 60, $param);

$object_retour->data["ID5d"] = intval($ID5d->data->data["nombre"]);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// fermé Critique
$param = new stdClass();
$param->priorite=35;
$param->date=$arrayValeur["date"];
$ID6a = getIndicateur($connection,$prefixTable, "ID6", 60, $param);

$object_retour->data["ID6a"] = intval($ID6a->data->data["nombre"]);

//--------------------------------------------------------------------------
// fermé Haute
$param = new stdClass();
$param->priorite=36;
$param->date=$arrayValeur["date"];
$ID6b = getIndicateur($connection,$prefixTable, "ID6", 60, $param);

$object_retour->data["ID6b"] = intval($ID6b->data->data["nombre"]);

//--------------------------------------------------------------------------
// fermé Moyenne
$param = new stdClass();
$param->priorite=37;
$param->date=$arrayValeur["date"];
$ID6c = getIndicateur($connection,$prefixTable, "ID6", 60, $param);

$object_retour->data["ID6c"] = intval($ID6c->data->data["nombre"]);

//--------------------------------------------------------------------------
// fermé Basse
$param = new stdClass();
$param->priorite=38;
$param->date=$arrayValeur["date"];
$ID6d = getIndicateur($connection,$prefixTable, "ID6", 60, $param);

$object_retour->data["ID6d"] = intval($ID6d->data->data["nombre"]);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// les tickets travaillés Critique
$param = new stdClass();
$param->priorite=35;
$param->date=$arrayValeur["date"];
$ID7a = getIndicateur($connection,$prefixTable, "ID7", 60, $param);

$object_retour->data["ID7a"] = intval($ID7a->data->data["nombre"]);

//--------------------------------------------------------------------------
// les tickets travaillés Haute
$param = new stdClass();
$param->priorite=36;
$param->date=$arrayValeur["date"];
$ID7b = getIndicateur($connection,$prefixTable, "ID7", 60, $param);

$object_retour->data["ID7b"] = intval($ID7b->data->data["nombre"]);

//--------------------------------------------------------------------------
// les tickets travaillés Moyenne
$param = new stdClass();
$param->priorite=37;
$param->date=$arrayValeur["date"];
$ID7c = getIndicateur($connection,$prefixTable, "ID7", 60, $param);

$object_retour->data["ID7c"] = intval($ID7c->data->data["nombre"]);

//--------------------------------------------------------------------------
// les tickets travaillés Basse
$param = new stdClass();
$param->priorite=38;
$param->date=$arrayValeur["date"];
$ID7d = getIndicateur($connection,$prefixTable, "ID7", 60, $param);

$object_retour->data["ID7d"] = intval($ID7d->data->data["nombre"]);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// ID11a
if($object_retour->data["ID6a"] != 0){
    $param = new stdClass();
    $idTocs_Id6a = getEnumValues($ID6a->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id6a;
    $param->date=$arrayValeur["date"];
    $ID11a = getIndicateur($connection,$prefixTable, "ID11", 0, $param);

    $object_retour->data["ID11a"] = intval($ID11a->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID11a"] = 0;
} 

//--------------------------------------------------------------------------
// ID11b
if($object_retour->data["ID6b"] != 0){
    $param = new stdClass();
    $idTocs_Id6b = getEnumValues($ID6b->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id6b;
    $param->date=$arrayValeur["date"];
    $ID11b = getIndicateur($connection,$prefixTable, "ID11", 0, $param);

    $object_retour->data["ID11b"] = intval($ID11b->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID11b"] = 0;
} 

//--------------------------------------------------------------------------
// ID11c
if($object_retour->data["ID6c"] != 0){
    $param = new stdClass();
    $idTocs_Id6c = getEnumValues($ID6c->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id6c;
    $param->date=$arrayValeur["date"];
    $ID11c = getIndicateur($connection,$prefixTable, "ID11", 0, $param);

    $object_retour->data["ID11c"] = intval($ID11c->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID11c"] = 0;
} 

//--------------------------------------------------------------------------
// ID11d
if($object_retour->data["ID6d"] != 0){
    $param = new stdClass();
    $idTocs_Id6d = getEnumValues($ID6d->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id6d;
    $param->date=$arrayValeur["date"];
    $ID11d = getIndicateur($connection,$prefixTable, "ID11", 0, $param);

    $object_retour->data["ID11d"] = intval($ID11d->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID11d"] = 0;
} 

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// ID12a
if($object_retour->data["ID7a"] != 0){
    $param = new stdClass();
    $idTocs_Id7a = getEnumValues($ID7a->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id7a;
    $param->date=$arrayValeur["date"];
    $ID12a = getIndicateur($connection,$prefixTable, "ID12", 0, $param);

    $object_retour->data["ID12a"] = intval($ID12a->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID12a"] = 0;
} 

//--------------------------------------------------------------------------
// ID12b
if($object_retour->data["ID7b"] != 0){
    $param = new stdClass();
    $idTocs_Id7b = getEnumValues($ID7b->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id7b;
    $param->date=$arrayValeur["date"];
    $ID12b = getIndicateur($connection,$prefixTable, "ID12", 0, $param);

    $object_retour->data["ID12b"] = intval($ID12b->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID12b"] = 0;
} 

//--------------------------------------------------------------------------
// ID12c
if($object_retour->data["ID7c"] != 0){
    $param = new stdClass();
    $idTocs_Id7c = getEnumValues($ID7c->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id7c;
    $param->date=$arrayValeur["date"];
    $ID12c = getIndicateur($connection,$prefixTable, "ID12", 0, $param);

    $object_retour->data["ID12c"] = intval($ID12c->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID12c"] = 0;
} 

//--------------------------------------------------------------------------
// ID12d
if($object_retour->data["ID7d"] != 0){
    $param = new stdClass();
    $idTocs_Id7d = getEnumValues($ID7d->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id7d;
    $param->date=$arrayValeur["date"];
    $ID12d = getIndicateur($connection,$prefixTable, "ID12", 0, $param);

    $object_retour->data["ID12d"] = intval($ID12d->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID12d"] = 0;
}

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// ID13a
if($object_retour->data["ID5a"] != 0){
    $param = new stdClass();
    $idTocs_Id5a = getEnumValues($ID5a->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id5a;
    $param->date=$arrayValeur["date"];
    $ID13a = getIndicateur($connection,$prefixTable, "ID13", 0, $param);

    $object_retour->data["ID13a"] = intval($ID13a->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID13a"] = 0;
} 

//--------------------------------------------------------------------------
// ID13b
if($object_retour->data["ID5b"] != 0){
    $param = new stdClass();
    $idTocs_Id5b = getEnumValues($ID5a->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id5b;
    $param->date=$arrayValeur["date"];
    $ID13b = getIndicateur($connection,$prefixTable, "ID13", 0, $param);

    $object_retour->data["ID13b"] = intval($ID13b->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID13b"] = 0;
} 

//--------------------------------------------------------------------------
// ID13c
if($object_retour->data["ID5c"] != 0){
    $param = new stdClass();
    $idTocs_Id5c = getEnumValues($ID5c->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id5c;
    $param->date=$arrayValeur["date"];
    $ID13c = getIndicateur($connection,$prefixTable, "ID13", 0, $param);

    $object_retour->data["ID13c"] = intval($ID13c->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID13c"] = 0;
} 

//--------------------------------------------------------------------------
// ID13d
if($object_retour->data["ID5d"] != 0){
    $param = new stdClass();
    $idTocs_Id5d = getEnumValues($ID5d->data->data["data"],"label","string");
    $param->tocs=$idTocs_Id5d;
    $param->date=$arrayValeur["date"];
    $ID13d = getIndicateur($connection,$prefixTable, "ID13", 0, $param);

    $object_retour->data["ID13d"] = intval($ID13d->data->data["data"][0]->totalCharge);
} else {
    $object_retour->data["ID13d"] = 0;
}

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID14
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID14 = getIndicateur($connection,$prefixTable, "ID14", 60, $param);

$object_retour->data["ID14"] = intval($ID14->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID15
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID15 = getIndicateur($connection,$prefixTable, "ID15", 60, $param);

$object_retour->data["ID15"] = intval($ID15->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID16
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID16 = getIndicateur($connection,$prefixTable, "ID16", 60, $param);

$object_retour->data["ID16"] = intval($ID16->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID17
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID17 = getIndicateur($connection,$prefixTable, "ID17", 60, $param);

$object_retour->data["ID17"] = intval($ID17->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID18
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID18 = getIndicateur($connection,$prefixTable, "ID18", 60, $param);

$object_retour->data["ID18"] = intval($ID18->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID19
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID19 = getIndicateur($connection,$prefixTable, "ID19", 60, $param);

$object_retour->data["ID19"] = intval($ID19->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID20
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID20 = getIndicateur($connection,$prefixTable, "ID20", 60, $param);

$object_retour->data["ID20"] = intval($ID20->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID21
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID21 = getIndicateur($connection,$prefixTable, "ID21", 60, $param);

$object_retour->data["ID21"] = intval($ID21->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID22
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID22 = getIndicateur($connection,$prefixTable, "ID22", 60, $param);

$object_retour->data["ID22"] = intval($ID22->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID23
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID23 = getIndicateur($connection,$prefixTable, "ID23", 60, $param);

$object_retour->data["ID23"] = intval($ID23->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID24
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID24 = getIndicateur($connection,$prefixTable, "ID24", 60, $param);

$object_retour->data["ID24"] = intval($ID24->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID25
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID25 = getIndicateur($connection,$prefixTable, "ID25", 60, $param);

$object_retour->data["ID25"] = floatval($ID25->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID26
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID26 = getIndicateur($connection,$prefixTable, "ID26", 60, $param);

$object_retour->data["ID26"] = floatval($ID26->data->data["data"][0]->totalCharge);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//ID27
$param = new stdClass();
$param->date=$arrayValeur["date"];
$ID27 = getIndicateur($connection,$prefixTable, "ID27", 60, $param);

$object_retour->data["ID27"] = intval($ID27->data->data["data"][0]->ferie);

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// ID1a fermé avec SLA dépassé Critique
if($object_retour->data["ID6a"] != 0){
    $param = new stdClass();
    $idTocs_Id6a = getEnumValues($ID6a->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id6a;
    $param->priorite=35;
    $ID1a = getIndicateur($connection,$prefixTable, "ID1", 0, $param);

    $object_retour->data["ID1a"] = intval($ID1a->data->data["nombre"]);
} else {
    $object_retour->data["ID1a"] = 0;
}

//--------------------------------------------------------------------------
// fermé avec SLA dépassé Haute
if($object_retour->data["ID6b"] != 0){
    $param = new stdClass();
    $idTocs_Id6b = getEnumValues($ID6b->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id6b;
    $param->priorite=36;
    $ID1b = getIndicateur($connection,$prefixTable, "ID1", 0, $param);

    $object_retour->data["ID1b"] = intval($ID1b->data->data["nombre"]);
} else {
    $object_retour->data["ID1b"] = 0;
}

//--------------------------------------------------------------------------
// fermé avec SLA dépassé Moyenne
if($object_retour->data["ID6c"] != 0){
    $param = new stdClass();
    $idTocs_Id6c = getEnumValues($ID6c->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id6c;
    $param->priorite=37;
    $ID1c = getIndicateur($connection,$prefixTable, "ID1", 0, $param);

    $object_retour->data["ID1c"] = intval($ID1c->data->data["nombre"]);
} else {
    $object_retour->data["ID1c"] = 0;
}

//--------------------------------------------------------------------------
// fermé avec SLA dépassé Basse
if($object_retour->data["ID6d"] != 0){
    $param = new stdClass();
    $idTocs_Id6d = getEnumValues($ID6d->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id6d;
    $param->priorite=38;
    $ID1d = getIndicateur($connection,$prefixTable, "ID1", 0, $param);

    $object_retour->data["ID1d"] = intval($ID1d->data->data["nombre"]);
} else {
    $object_retour->data["ID1d"] = 0;
}

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// ID9a
if($object_retour->data["ID3a"] != 0){
    $param = new stdClass();
    $idTocs_Id3a = getEnumValues($ID3a->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id3a;
    $ID9a = getIndicateur($connection,$prefixTable, "ID9", 0, $param);

    $object_retour->data["ID9a"] = intval($ID9a->data->data["nombre"]);
} else {
    $object_retour->data["ID9a"] = 0;
}

//--------------------------------------------------------------------------
// ID9b
if($object_retour->data["ID3b"] != 0){
    $param = new stdClass();
    $idTocs_Id3b = getEnumValues($ID3b->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id3b;
    $ID9b = getIndicateur($connection,$prefixTable, "ID9", 0, $param);

    $object_retour->data["ID9b"] = intval($ID9b->data->data["nombre"]);
} else {
    $object_retour->data["ID9b"] = 0;
}

//--------------------------------------------------------------------------
// ID9c
if($object_retour->data["ID3c"] != 0){
    $param = new stdClass();
    $idTocs_Id3c = getEnumValues($ID3c->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id3c;
    $ID9c = getIndicateur($connection,$prefixTable, "ID9", 0, $param);

    $object_retour->data["ID9c"] = intval($ID9c->data->data["nombre"]);
} else {
    $object_retour->data["ID9c"] = 0;
}

//--------------------------------------------------------------------------
// ID9d
if($object_retour->data["ID3d"] != 0){
    $param = new stdClass();
    $idTocs_Id3d = getEnumValues($ID3d->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id3d;
    $ID9d = getIndicateur($connection,$prefixTable, "ID9", 0, $param);

    $object_retour->data["ID9d"] = intval($ID9d->data->data["nombre"]);
} else {
    $object_retour->data["ID9d"] = 0;
}

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// ID10a
if($object_retour->data["ID3a"] != 0){
    $param = new stdClass();
    $idTocs_Id3a = getEnumValues($ID3a->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id3a;
    $ID10a = getIndicateur($connection,$prefixTable, "ID10", 0, $param);

    $object_retour->data["ID10a"] = intval($ID10a->data->data["nombre"]);
} else {
    $object_retour->data["ID10a"] = 0;
}

//--------------------------------------------------------------------------
// ID10b
if($object_retour->data["ID3b"] != 0){
    $param = new stdClass();
    $idTocs_Id3b = getEnumValues($ID3b->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id3b;
    $ID10b = getIndicateur($connection,$prefixTable, "ID10", 0, $param);

    $object_retour->data["ID10b"] = intval($ID10b->data->data["nombre"]);
} else {
    $object_retour->data["ID10b"] = 0;
}

//--------------------------------------------------------------------------
// ID10c
if($object_retour->data["ID3c"] != 0){
    $param = new stdClass();
    $idTocs_Id3c = getEnumValues($ID3c->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id3c;
    $ID10c = getIndicateur($connection,$prefixTable, "ID10", 0, $param);

    $object_retour->data["ID10c"] = intval($ID10c->data->data["nombre"]);
} else {
    $object_retour->data["ID10c"] = 0;
}

//--------------------------------------------------------------------------
// ID10d
if($object_retour->data["ID3d"] != 0){
    $param = new stdClass();
    $idTocs_Id3d = getEnumValues($ID3d->data->data["data"],"id_toc","string");
    $param->tocs=$idTocs_Id3d;
    $ID10d = getIndicateur($connection,$prefixTable, "ID10", 0, $param);

    $object_retour->data["ID10d"] = intval($ID10d->data->data["nombre"]);
} else {
    $object_retour->data["ID10d"] = 0;
}

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// Critique
$object_retour->data["ID8a"] = $object_retour->data["ID1a"] + $object_retour->data["ID2a"]
        + $object_retour->data["ID3a"] + $object_retour->data["ID4a"] - $object_retour->data["ID6a"]
    ;

//--------------------------------------------------------------------------
// Haute
$object_retour->data["ID8b"] = $object_retour->data["ID1b"] + $object_retour->data["ID2b"]
        + $object_retour->data["ID3b"] + $object_retour->data["ID4b"] - $object_retour->data["ID6b"]
    ;

//--------------------------------------------------------------------------
// Moyenne
$object_retour->data["ID8c"] = $object_retour->data["ID1c"] + $object_retour->data["ID2c"]
        + $object_retour->data["ID3c"] + $object_retour->data["ID4c"] - $object_retour->data["ID6c"]
    ;

//--------------------------------------------------------------------------
// Basse
$object_retour->data["ID8d"] = $object_retour->data["ID1d"] + $object_retour->data["ID2d"]
        + $object_retour->data["ID3d"] + $object_retour->data["ID4d"] - $object_retour->data["ID6d"]
    ;

//--------------------------------------------------------------------------
$object_retour->metro["etape99"] = getDateTimeWithMili();

//--------------------------------------------------------------------------
if($modeDebug){
    $strSorti .= ($sql);
}

require("../API/php/footer.php");
?>